package com.zsc.newbuds.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.Calendar;

/**
 * 页面跳转
 * @author D
 */
@Controller
public class JumpPageController {

    @RequestMapping("/information")
    public String toAdminInformation() {
        return "redirect:admin/adminInfo/information.html";
    }
    @RequestMapping("admin/adminInfo/information.html")
    public String toInformation(){
        return "admin/adminInfo/information";
    }



    @RequestMapping("/employeeList")
    public String toEmpList() {
        return "redirect:admin/empManagement/employeeList.html";
    }
    @RequestMapping("admin/empManagement/employeeList.html")
    public String empList(){
        return "admin/empManagement/employeeList";
    }

    @RequestMapping("/volunteerApproval")
    public String toVolunteerApproval() {
        return "redirect:admin/volunteerManagement/volunteerApproval.html";
    }
    @RequestMapping("admin/volunteerManagement/volunteerApproval.html")
    public String volunteerApproval(){
        return "admin/volunteerManagement/volunteerApproval";
    }

    @RequestMapping("/addRecyclingArea")
    public String toAddRecyclingArea() {
        return "redirect:admin/areaManagement/addRecyclingArea.html";
    }
    @RequestMapping("admin/areaManagement/addRecyclingArea.html")
    public String addRecyclingArea(){
        return "admin/areaManagement/addRecyclingArea";
    }

    @RequestMapping("/recyclingAreaList")
    public String toRecyclingAreaList() {
        return "redirect:admin/areaManagement/RecyclingAreaList.html";
    }
    @RequestMapping("admin/areaManagement/RecyclingAreaList.html")
    public String recyclingAreaList(){
        return "admin/areaManagement/RecyclingAreaList";
    }

    @RequestMapping("/personnelAllotment")
    public String toPersonnelAllotment() {
        return "redirect:admin/recyclingServices/personnelAllotment.html";
    }
    @RequestMapping("admin/recyclingServices/personnelAllotment.html")
    public String personnelAllotment(){
        return "admin/recyclingServices/personnelAllotment";
    }

    @RequestMapping("/personnelStatus")
    public String toPersonnelStatus() {
        return "redirect:admin/recyclingServices/personnelStatus.html";
    }
    @RequestMapping("admin/recyclingServices/personnelStatus.html")
    public String personnelStatus(){
        return "admin/recyclingServices/personnelStatus";
    }

    @RequestMapping("/donationList")
    public String toDonationList() {
        return "redirect:admin/donationManagement/donationList.html";
    }
    @RequestMapping("admin/donationManagement/donationList.html")
    public String donationList(){
        return "admin/donationManagement/donationList";
    }

    @RequestMapping("/donationRecord")
    public String toDonationRecord() {
        return "redirect:admin/donationManagement/donationRecord.html";
    }
    @RequestMapping("admin/donationManagement/donationRecord.html")
    public String donationRecord(){
        return "admin/donationManagement/donationRecord";
    }

    @RequestMapping("/discardedClothing")
    public String toDiscardedClothing() {
        return "redirect:admin/donationManagement/discardedClothing.html";
    }
    @RequestMapping("admin/donationManagement/discardedClothing.html")
    public String discardedClothing(){
        return "admin/donationManagement/discardedClothing";
    }

    @RequestMapping("/addDonationArea")
    public String toAddDonationArea() {
        return "redirect:admin/DonationAreaManagement/addDonationArea.html";
    }
    @RequestMapping("admin/DonationAreaManagement/addDonationArea.html")
    public String addDonationArea(){
        return "admin/DonationAreaManagement/addDonationArea";
    }

    @RequestMapping("/distributionMaterials")
    public String toDistributionMaterials() {
        return "redirect:admin/donationManagement/distributionMaterials.html";
    }
    @RequestMapping("admin/donationManagement/distributionMaterials.html")
    public String distributionMaterials(){ return "admin/donationManagement/distributionMaterials"; }

    @RequestMapping("/shopList")
    public String toShopList() { return "redirect:admin/shopManagement/shopList.html";}
    @RequestMapping("/admin/shopManagement/shopList.html")
    public String shopList(){ return "admin/shopManagement/shopList";}

    @RequestMapping("/volunteerList")
    public String toVolunteerList() {
        return "redirect:admin/empManagement/volunteerList.html";
    }
    @RequestMapping("admin/empManagement/volunteerList.html")
    public String volunteerList(){ return "admin/empManagement/volunteerList"; }

    @RequestMapping("/donatedRecords")
    public String toDonatedRecords() {
        return "redirect:admin/processedRecords/donatedRecords.html";
    }
    @RequestMapping("admin/processedRecords/donatedRecords.html")
    public String donatedRecords(){ return "admin/processedRecords/donatedRecords"; }

    @RequestMapping("/clothingSalesRecord")
    public String toClothingSalesRecord() {
        return "redirect:admin/processedRecords/clothingSalesRecord.html";
    }
    @RequestMapping("admin/processedRecords/clothingSalesRecord.html")
    public String clothingSalesRecord(){ return "admin/processedRecords/clothingSalesRecord"; }

    @RequestMapping("/userList")
    public String toUserList() {
        return "redirect:admin/userManagement/userList.html";
    }
    @RequestMapping("admin/userManagement/userList.html")
    public String userList(){ return "admin/userManagement/userList"; }

    @RequestMapping("/exchangeRecord")
    public String toExchangeRecord() {
        return "redirect:admin/shopManagement/exchangeRecord.html";
    }
    @RequestMapping("admin/shopManagement/exchangeRecord.html")
    public String exchangeRecord(){ return "admin/shopManagement/exchangeRecord"; }

    @RequestMapping("/")
    public String toIndex(){
        //System.out.println("进入了这里");
        return "redirect:main/index.html";}

    @RequestMapping("main/index.html")
    public String toMainIndex(HttpSession session){
        session.setAttribute("currentYear", Calendar.getInstance().get(Calendar.YEAR));
        System.out.println(session.getAttribute("currentYear")+"session");
        System.out.println(session.getAttribute("user")+"User");
        return "main/index";}
}
